home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / contrib / pdcurs22 / docs / basics / intro.man next >
Encoding:
Text File  |  1995-01-26  |  16.9 KB  |  520 lines

  1. /*man-start*********************************************************************
  2.  
  3.         Introduction to XSI Curses Interface
  4.  
  5. The X/Open Group has identified a strong need for a generic terminal
  6. interface for applications that wish to be independent of terminal
  7. hardware and connection method.
  8.  
  9. This interface should allow the attachment of character and
  10. block-oriented terminals.  Furthermore, it should not put any
  11. constraints on how the terminals are attached (e.g., Local Area
  12. Networks, PADs on X.25, etc.). 
  13.  
  14. The curses library interfaces provides the user with a method of
  15. updating screens with reasonable optimisation. 
  16.  
  17. The X/Open group has found it impossible to define a totally portable
  18. set of curses interface routines that cover asynchronous, networked,
  19. and synchronous terminals.  The functions are oriented towards locally
  20. connected asynchronous terminals.  For such terminals, applications
  21. conforming to this interface are portable.  The interface routines
  22. curses may, however, also be used with synchronous and networked
  23. terminals, provided the restrictions below are considered. 
  24.  
  25. These functions have been included been included in the X/Open
  26. definition in the "optional" category.  This means that although they
  27. are likely to appear on many X/Open compliant systems, they are not
  28. guaranteed to be on all systems.  Where they are supported, they will
  29. conform to the given definition. 
  30.  
  31.  
  32. ----------------------------------------------------------------------
  33.  
  34.         Synchronous and Networked Asynchronous Terminals
  35.  
  36. These notes indicate to the application writer some considerations to
  37. be borne in mind when driving synchronous, networked asynchronous
  38. (NWA) or non-standard directly connected asynchronous terminals.
  39.  
  40. Such terminals are often used in a mainframe environment and
  41. communicatie to the host in block mode.  That is, the user types
  42. characters at the terminal then presses a special key to initiate
  43. transmission of the characters to the host. 
  44.  
  45. Frequently, although it may be possible to send arbitrary sized blocks
  46. to the host, it may not be possible or desireable to cause a character
  47. to be transmitted with only a single keystroke. 
  48.  
  49. This can cause severe problems to an application wishing to make use
  50. of single character input. 
  51.  
  52.  
  53.  
  54. OUTPUT
  55.  
  56. The curses package can be used in the normal way for all operations
  57. pertaining to output to the terminal, with the possible exception that
  58. on some terminals the refresh() routine may have to redraw the entire
  59. screen contents in order to perform any update.
  60.  
  61. If it is additionally necessary to clear the screen before each such
  62. operation, the result could be unacceptable. 
  63.  
  64.  
  65. INPUT
  66.  
  67. Because of the nature of operation of synchronous (block-mode) and NWA
  68. terminals, it may not be possible to support all or any of the curses
  69. input functions.  In particular, the following points should be noted:
  70.  
  71. * Single-character input may not be possible.  It may be necessary to
  72.   press a special key to cause all characters typed at the terminal to
  73.   be transmitted to the host. 
  74.  
  75. * It may not be possibel to disable echo.  Character echo may be performed
  76.   directly by the terminal.  On terminals that behave this way, any curses
  77.   application that performs input should be aware that any characters
  78.   type will appear on the screen wherever the cursor is positioned.
  79.   This may not necessarily correspond to the position of the cursor in
  80.   the window.
  81.  
  82.  
  83. ----------------------------------------------------------------------
  84.  
  85.         Data Types and the <curses.h> Header
  86.  
  87. The data types supported by curses are described in this section.
  88.  
  89. As the library supports a procedural interface to the data types,
  90. actual structure contents are not described.  All curses data are
  91. manipulated using the routines provided. 
  92.  
  93.  
  94. THE <curses.h> HEADER
  95.  
  96. The <curses.h> header defines various constants and declares the data types
  97. that are available to the application.
  98.  
  99.  
  100. DATA TYPES
  101.  
  102. The following data types are declared:
  103.  
  104.     WINDOW*        pointer to screen representation
  105.     SCREEN*        pointer to terminal descriptor
  106.     bool        boolean data type
  107.     chtype        representation of a character in a window
  108.  
  109. The actual WINDOW and SCREEN objects used to store information are
  110. created by the corresponding routines and a pointer to them is
  111. provided.  All manipulation is through that pointer. 
  112.  
  113.  
  114. CONSTANTS
  115.  
  116. The following constants are defined. 
  117.  
  118.  
  119. GENERAL
  120.  
  121.     COLS        number of columns on terminal screen
  122.     ERR        value returned on error condition
  123.     FALSE        boolean false value
  124.     LINES        number of lines on terminal screen
  125.     OK        value returned on successful completion
  126.     NULL        zero pointer value
  127.     TRUE        boolean true value
  128.  
  129. VIDEO ATTRIBUTES
  130.  
  131.     A_BLINK        blinking
  132.     A_BOLD        extra bright or bold
  133.     A_DIM        half bright
  134.     A_REVERSE    reverse video
  135.     A_STANDOUT    terminal's best highlighting mode
  136.     A_UNDERLINE    underlining
  137.     A_ATTRIBUTES    bit-mask to extract attributes
  138.     A_CHARTEXT    bit-mask to extract a character
  139.  
  140. Normally, attributres are a property of the character. 
  141.  
  142.  
  143. INPUT VALUES
  144.  
  145. The following constants might be returned by getch() if keypad() has
  146. been enabled.  Note that not all of these may be supported on a
  147. particular terminal if the terminal does not transmit a unique code
  148. when the key is pressed or the definition for the key is not present
  149. in the underlying table of terminal capabilities. 
  150.  
  151.     KEY_BREAK    break key
  152.     KEY_DOWN    the four arrow keys
  153.     KEY_UP
  154.     KEY_LEFT
  155.     KEY_RIGHT
  156.     KEY_HOME    home key (upward+left arrow)
  157.     KEY_BACKSPACE    backspace
  158.     KEY_F0        function keys; space for 64 keys is reserved
  159.     KEY_F(n)    (KEY_F0+(n))
  160.     KEY_DL        delete line
  161.     KEY_IL        insert line
  162.     KEY_DC        delete character
  163.     KEY_IC        insert character
  164.     KEY_EIC        exit insert character mode
  165.     KEY_CLEAR    clear screen
  166.     KEY_EOS        clear to end of screen
  167.     KEY_EOL        clear to end of line
  168.     KEY_SF        scroll 1 line forwards
  169.     KEY_SR        scroll 1 line backwards (reverse)
  170.     KEY_NPAGE    next page
  171.     KEY_PPAGE    previous page
  172.     KEY_STAB    set tab
  173.     KEY_CTAB    clear tab
  174.     KEY_CATAB    clear all tabs
  175.     KEY_ENTER    enter or send
  176.     KEY_SRESET    soft (partial) reset
  177.     KEY_RESET    reset or hard reset
  178.     KEY_PRINT    print or copy
  179.     KEY_LL        home down or bottom (lower left)
  180.     KEY_A1        upper left of virtual keypad
  181.     KEY_A3        upper right of virtual keypad
  182.     KEY_B2        centre of virtual keypad
  183.     KEY_C1        lower left of virtual keypad
  184.     KEY_C3        lower right of virtual keypad
  185.  
  186. The virtual keypad is arranged like this:
  187.  
  188.     A1    up    A3
  189.     left    B2    right
  190.     C1    down    C3
  191.  
  192. FUNCTIONS
  193.  
  194.     The following table lists each curses routine and the name of the 
  195.     manual page on which it is described. This list is based on
  196.     System V R4 curses:
  197.  
  198.        Curses Function        Manual Page Name
  199.  
  200.         addch                 addch
  201.         addchnstr             addchstr
  202.         addchstr              addchstr
  203.         addnstr               addstr
  204.         addstr                addstr
  205.         attroff               attr
  206.         attron                attr
  207.         baudrate              termattr
  208.         beep                  beep
  209.         bkgd                  bkgd
  210.         bkgdset               bkgd
  211.         border                border
  212.         box                   border
  213.         can_change_color      color
  214.         cbreak                inopts
  215.         clear                 clear
  216.         clearok               outopts
  217.         clrtobot              clear
  218.         clrtoeol              clear
  219.         color_content         *** color
  220.         copywin               overlay
  221.         curs_set              kernel
  222.         def_prog_mode         kernel
  223.         def_shell_mode        kernel
  224.         del_curterm           *** terminfo
  225.         delay_output          util
  226.         delch                 delch
  227.         deleteln              deleteln
  228.         delscreen             *** initscr
  229.         delwin                window
  230.         derwin                window
  231.         doupdate              refresh
  232.         dupwin                window
  233.         echo                  inopts
  234.         echochar              addch
  235.         endwin                initscr
  236.         erase                 clear
  237.         erasechar             termattr
  238.         filter                *** util
  239.         flash                 beep
  240.         flushinp              util
  241.         getbegyx              getyx
  242.         getch                 getch
  243.         getmaxyx              getyx
  244.         getparyx              getyx
  245.         getstr                getstr
  246.         getsyx                *** kernel
  247.         getwin                *** util
  248.         getyx                 getyx
  249.         halfdelay             *** inopts
  250.         has_colors            color
  251.         has_ic                termattr
  252.         has_il                termattr
  253.         hline                 border
  254.         idcok                 outopts
  255.         idlok                 outopts
  256.         immedok               outopts
  257.         inch                  inch
  258.         inchnstr              inchstr
  259.         inchstr               inchstr
  260.         init_color            color
  261.         init_pair             color
  262.         initscr               initscr
  263.         innstr                instr
  264.         insch                 insch
  265.         insdelln              deleteln
  266.         insertln              deleteln
  267.         insnstr               innstr
  268.         insstr                innstr
  269.         instr                 instr
  270.         intrflush             inopts
  271.         is_linetouched        touch
  272.         is_wintouched         touch
  273.         isendwin              *** initscr
  274.         keyname               util
  275.         keypad                inopts
  276.         killchar              termattr
  277.         leaveok               outopts
  278.         longname              termattr
  279.         meta                  inopts
  280.         move                  move
  281.         mvaddch               addch
  282.         mvaddchnstr           addchstr
  283.         mvaddchstr            addchstr
  284.         mvaddnstr             addstr
  285.         mvaddstr              addstr
  286.         mvcur                 terminfo
  287.         mvdelch               delch
  288.         mvderwin              window
  289.         mvgetch               getch
  290.         mvgetstr              getstr
  291.         mvinch                inch
  292.         mvinchnstr            inchstr
  293.         mvinchstr             inchstr
  294.         mvinnstr              instr
  295.         mvinsch               insch
  296.         mvinsnstr             insstr
  297.         mvinsstr              insstr
  298.         mvinstr               instr
  299.         mvprintw              printw
  300.         mvscanw               scanw
  301.         mvwaddch              addch
  302.         mvwaddchnstr          addchstr
  303.         mvwaddchstr           addchstr
  304.         mvwaddnstr            addstr
  305.         mvwaddstr             addstr
  306.         mvwdelch              delch
  307.         mvwgetch              getch
  308.         mvwgetstr             getstr
  309.         mvwin                 window
  310.         mvwinch               inch
  311.         mvwinchnstr           inchstr
  312.         mvwinchstr            inchstr
  313.         mvwinnstr             instr
  314.         mvwinsch              insch
  315.         mvwinsnstr            insstr
  316.         mvwinsstr             insstr
  317.         mvwinstr              instr
  318.         mvwprintw             printw
  319.         mvwscanw              scanw
  320.         napms                 kernel
  321.         newpad                pad
  322.         newterm               *** initscr
  323.         newwin                window
  324.         nl                    outopts
  325.         nocbreak              inopts
  326.         nodelay               inopts
  327.         noecho                inopts
  328.         nonl                  outopts
  329.         noqiflush             *** inopts
  330.         noraw                 inopts
  331.         notimeout             inopts
  332.         overlay               overlay
  333.         overwrite             overlay
  334.         pair_content          color
  335.         pechochar             pad
  336.         pnoutrefresh          pad
  337.         prefresh              pad
  338.         printw                printw
  339.         putp                  *** terminfo
  340.         putwin                *** util
  341.         qiflush               *** inopts
  342.         raw                   inopts
  343.         raw_output            outopts
  344.         redrawwin             refresh
  345.         refresh               refresh
  346.         reset_prog_mode       kernel
  347.         reset_shell_mode      kernel
  348.         resetty               kernel
  349.         restartterm           *** terminfo
  350.         ripoffline            *** kernel
  351.         savetty               kernel
  352.         scanw                 scanw
  353.         scr_dump              *** scr_dump
  354.         scr_init              *** scr_dump
  355.         scr_restore           *** scr_dump
  356.         scr_set               *** scr_dump
  357.         scrl                  scroll
  358.         scroll                scroll
  359.         scrollok              outopts
  360.         set_term              initscr
  361.         setscrreg             outopts
  362.         setsyx                *** kernel
  363.         setterm               *** terminfo
  364.         setupterm             *** terminfo
  365.         slk_attroff           *** slk
  366.         slk_attron            *** slk
  367.         slk_attrset           *** slk
  368.         slk_clear             *** slk
  369.         slk_init              *** slk
  370.         slk_label             *** slk
  371.         slk_noutrefresh       *** slk
  372.         slk_refresh           *** slk
  373.         slk_restore           *** slk
  374.         slk_set               *** slk
  375.         slk_touch             *** slk
  376.         standend              attr
  377.         standout              attr
  378.         start_color           color
  379.         subpad                pad
  380.         subwin                window
  381.         syncok                *** window
  382.         termattrs             termattrs
  383.         termname              termattrs
  384.         tgetent               *** termcap
  385.         tgetflag              *** termcap
  386.         tgetnum               *** termcap
  387.         tgetstr               *** termcap
  388.         tgoto                 *** termcap
  389.         tigetflag             *** terminfo
  390.         tigetnum              *** terminfo
  391.         tigetstr              *** terminfo
  392.         timeout               *** inopts
  393.         touchline             touch
  394.         touchwin              touch
  395.         tparm                 *** terminfo
  396.         tputs                 *** terminfo
  397.         tputs                 *** termcap
  398.         trace_on              pdcdebug
  399.         typeahead             inopts
  400.         unctrl                util
  401.         ungetch               getch
  402.         untouchwin            touch
  403.         use_env               *** util
  404.         vidattr               *** terminfo
  405.         vidputs               *** terminfo
  406.         vline                 border
  407.         vwprintw              *** printw
  408.         vwscanw               *** scanw
  409.         waddch                addch
  410.         waddchnstr            addchstr
  411.         waddchstr             addchstr
  412.         waddnstr              addstr
  413.         waddstr               addstr
  414.         wattroff              attr
  415.         wattron               attr
  416.         wattrset              attr
  417.         wbkgd                 bkgd
  418.         wbkgdset              bkgd
  419.         wborder               border
  420.         wclear                clear
  421.         wclrtobot             clear
  422.         wclrtoeol             clear
  423.         wcursyncup            *** window
  424.         wdelch                delch
  425.         wdeleteln             deleteln
  426.         wechochar             addch
  427.         werase                clear
  428.         wgetch                getch
  429.         wgetnstr              getstr
  430.         wgetstr               getstr
  431.         whline                border
  432.         winch                 inch
  433.         winchnstr             inchstr
  434.         winchstr              inchstr
  435.         winnstr               instr
  436.         winsch                insch
  437.         winsdelln             deleteln
  438.         winsertln             deleteln
  439.         winsnstr              insstr
  440.         winsstr               insstr
  441.         winstr                instr
  442.         wmove                 move
  443.         wnoutrefresh          refresh
  444.         wordchar              termattr
  445.         wprintw               printw
  446.         wredrawln             refresh
  447.         wrefresh              refresh
  448.         wscanw                scanw
  449.         wscrl                 scroll
  450.         wsetscrreg            outopts
  451.         wstandend             attr
  452.         wstandout             attr
  453.         wsyncdown             *** window
  454.         wsyncup               *** window
  455.         wtimeout              *** inopts
  456.         wtouchln              touch
  457.         wvline                border
  458.  
  459.     The following table lists each private curses routine and the name 
  460.     of the manual page on which it is described. These routines should
  461.     not be used directly if portability is to be considered.
  462.  
  463.        Curses Function        Manual Page Name
  464.  
  465.         PDC_backchar          pdcdisp
  466.         PDC_chadd             pdcdisp
  467.         PDC_check_bios_key    pdckbd
  468.         PDC_chg_attrs         pdcdisp
  469.         PDC_chg_attr_pair     pdcdisp
  470.         PDC_chins             pdcdisp
  471.         PDC_clr_scrn          pdcdisp
  472.         PDC_clr_update        pdcdisp
  473.         PDC_copy_win          pdcwin
  474.         PDC_cursor_off        pdcdisp
  475.         PDC_cursor_on         pdcdisp
  476.         PDC_debug             pdcdebug
  477.         PDC_fix_cursor        pdcdisp
  478.         PDC_getch             getch
  479.         PDC_get_attribute     pdcgetsc
  480.         PDC_get_bios_key      pdckbd
  481.         PDC_get_columns       pdcgetsc
  482.         PDC_get_ctrl_break    pdckbd
  483.         PDC_get_cursor_mode   pdcgetsc
  484.         PDC_get_cursor_pos    pdcgetsc
  485.         PDC_get_cur_col       pdcgetsc
  486.         PDC_get_cur_row       pdcgetsc
  487.         PDC_get_font          pdcgetsc
  488.         PDC_get_rows          pdcgetsc
  489.         PDC_get_scrn_mode     pdcgetsc
  490.         PDC_gotoxy            pdcdisp
  491.         PDC_makenew           pdcwin
  492.         PDC_memmove           pdcutil
  493.         PDC_newline           pdcdisp
  494.         PDC_print             pdcprint
  495.         PDC_putc              pdcdisp
  496.         PDC_putctty           pdcdisp
  497.         PDC_query_adapter_type  pdcgetsc
  498.         PDC_rawgetch          pdckbd
  499.         PDC_sanity_check      pdcgetsc
  500.         PDC_scrn_modes_equal  pdcscrn      
  501.         PDC_scroll            pdcdisp
  502.         PDC_scr_close         pdcscrn
  503.         PDC_scr_open          pdcscrn
  504.         PDC_set_80x25         pdcsetsc
  505.         PDC_set_ctrl_break    pdckbd
  506.         PDC_set_cursor_mode   pdcsetsc
  507.         PDC_set_font          pdcsetsc
  508.         PDC_set_rows          pdcsetsc
  509.         PDC_set_scrn_mode     pdcsetsc
  510.         PDC_sysgetch          pdckbd
  511.         PDC_transform_line    pdcdisp
  512.         PDC_usleep            pdcutil
  513.         PDC_validchar         pdckbd
  514.         PDC_vsscanf           pdcutil
  515.  
  516.     NOTE: Functions prefixed with '***' above and on each manual page are 
  517.         functions that have not been implemented.
  518.  
  519. **man-end**********************************************************************/
  520.